<template>
  <div>{{ title || 'page1' }} <el-button @click="handleClick">点击事件</el-button> </div>
</template>

<script setup lang="ts">
  const props = defineProps<{ title?: string; params?: any }>()

  const emits = defineEmits(['click'])

  function handleClick() {
    console.log('点击事件')
    emits('click', props.params)
  }

  onMounted(() => {
    console.log('page初始化')
  })
</script>
